import { request,BASEURL} from '../../utils/request';
Page({

  /**
   * 页面的初始数据
   */
  data: {
    goodsEarn:[]
  },
  onLoad: function (options) {
    this.goodsEarn()
  },
  //收益记录数据
  async goodsEarn(){
    let {openid} = wx.getStorageSync('uid')
    let res = await request({
      url: '/api/Wxapp/profitLog',
      method:"POST",
      data:{
        openid
      }
    })
    console.log(res)
    let goodsEarn = res.data.data
    this.setData({
      goodsEarn
    })
  },
  

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },
  onShow: function () {

  },
  onHide: function () {

  },


  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    let {openid} = wx.getStorageSync('uid')
    return {
      title: "邀请好友",
      path:`/pages/index/index?pid=${openid}` 
    }
  }
})